/**
 *******************************************************************************
 *                 Copyright (C) 2017 - 2019  Accumulate Team                  *
 *                                                                             *
 *      Licensed under the Apache License, Version 2.0 (the "License");        *
 *      you may not use this file except in compliance with the License.       *
 *      You may obtain a copy of the License at                                *
 *                 http://www.apache.org/licenses/LICENSE-2.0                  *
 *                                                                             *
 *   Unless required by applicable law or agreed to in writing, software       *
 *   distributed under the License is distributed on an "AS IS" BASIS,         *
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  *
 *   See the License for the specific language governing permissions and       *
 *   limitations under the License.                                            *
 *******************************************************************************
 * @file       sm_config.h                                                     *
 * @author     Accumulate Team                                                 *
 * @version    1.0.0                                                           *
 * @date       2017-01-10                                                      *
 * @brief      framework state machine config head file                        *
 * @par        work platform                                                   *
 *                 Windows                                                     *
 * @par        compiler                                                        *
 *                 GCC                                                         *
 *******************************************************************************
 * @note                                                                       *
 * 1.20170110    创建文件                                                      *
 *******************************************************************************
 */

/**
 * @defgroup framework state machine config
 * @{
 */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STATE_MACHINE_PORT_YSF_CONFIG_H__
#define __STATE_MACHINE_PORT_YSF_CONFIG_H__

/* Includes ------------------------------------------------------------------*/
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include "fw_core.h"

/* Add c++ compatibility -----------------------------------------------------*/
#ifdef __cplusplus
extern "C"
{
#endif

/* Exported macro ------------------------------------------------------------*/
/**
 *******************************************************************************
 * @brief      定义SM任务优先级
 *******************************************************************************
 */
#define SM_TASK_PRIO 3

/**
 *******************************************************************************
 * @brief      定义SM时钟节拍
 *******************************************************************************
 */
#define SM_CORE_TICK 1

    /**
 *******************************************************************************
 * @brief      定义SM消息队列大小
 *******************************************************************************
 */
#define STATE_MACHINE_MESSAGE_QUEUE_MAX 50

/**
 *******************************************************************************
 * @brief      定义SM最大层级
 *******************************************************************************
 */
#define SM_LAYER_MAX 5

/**
 *******************************************************************************
 * @brief      定义SM状态表使能状态
 *******************************************************************************
 */
#define SM_TICK_MAX FW_TICK_MAX

/**
 *******************************************************************************
 * @brief      定义SM日志输出API
 *******************************************************************************
 */
#define SMLOG LOG

/**
 *******************************************************************************
 * @brief      定义SM日志输出API
 *******************************************************************************
 */
#define SM_LOG  LOG_I
#define SM_WARN LOG_W
#define SM_ERR  LOG_E
  
/**
 *******************************************************************************
 * @brief      定义SM断言API
 *******************************************************************************
 */
#define SM_ASSERT(exp)
  
/**
 *******************************************************************************
 * @brief      定义SM内存分配释放API
 *******************************************************************************
 */
#define SM_MALLOC malloc
#define SM_FREE   free

/* Exported types ------------------------------------------------------------*/
typedef uint32_t sm_tick_t;

typedef fwbus_obj_t sm_parent_t;

/* Exported variables --------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/

/* Add c++ compatibility------------------------------------------------------*/
#ifdef __cplusplus
}
#endif
	
#endif       /** end include define */

/** @}*/     /** framework state machine config */

/**********************************END OF FILE*********************************/
